package com.ecoolex.ying.space.core.pojo;

import com.google.common.collect.Lists;

import java.io.Serializable;
import java.util.List;

public class ChildNode implements Node, Serializable {
    private String name;
    private List<Node> childList;

    public ChildNode(String name) {
        this.name = name;
        this.childList = Lists.newArrayList();
    }

    public ChildNode(Root root, String name) {
        this.name = name;
        this.childList = Lists.newArrayList();
    }

    public String getName() {
        return name;
    }

    public ChildNode setName(String name) {
        this.name = name;
        return this;
    }

    public List<Node> getChildList() {
        return childList;
    }

    public ChildNode setChildList(List<Node> childList) {
        this.childList = childList;
        return this;
    }

    public ChildNode addChildList(Node node) {
        this.childList.add(node);
        return this;
    }

}
